#include "savewindow.h"
#include "mainwindow.h"
#include <QDebug>
#include <QScrollArea>
#include <QWidget>
#include <QObject>
#include <QLineEdit>
#include <QPushButton>
#include <QString>
#include <QFileDialog>

SaveWindow::SaveWindow(QWidget *parent) :
    QDialog(parent)
{
    setFixedSize(160,70);
    this->line = new QLineEdit(this);
    QPushButton *search = new QPushButton("...", this);
    QPushButton *valid = new QPushButton("Valider", this);
    line->setGeometry(30,10,100,20);
    search->setGeometry(130, 10, 30, 20);
    valid->setGeometry(30,35,80,20);

    this->connect(search,      SIGNAL(clicked()),              this, SLOT(slotSearch()));
}

void SaveWindow::slotSearch()
{
    QString fileName = QFileDialog::getExistingDirectory(this, tr("Open Directory"),"/home",QFileDialog::ShowDirsOnly);
    this->line->setText(fileName);
}
